package com.heima.comment.controller.v1;

import com.heima.comment.service.CommentRepayService;
import com.heima.model.comment.dtos.CommentLikeDTO;
import com.heima.model.comment.dtos.CommentRepayDTO;
import com.heima.model.comment.dtos.CommentRepayLikeDTO;
import com.heima.model.comment.dtos.CommentRepaySaveDTO;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("api/v1/comment_repay")
public class RepayCommentController {

    @Autowired
    CommentRepayService commentRepayService;

    @PostMapping("save")
    public ResponseResult like(@RequestBody CommentRepaySaveDTO dto){
        return commentRepayService.saveCommentRepay(dto);
    }


    @PostMapping("load")
    public ResponseResult load(@RequestBody CommentRepayDTO dto){
        return commentRepayService.loadCommentRepay(dto);
    }


    @PostMapping("like")
    public ResponseResult like(@RequestBody CommentRepayLikeDTO dto){
        return commentRepayService.saveCommentRepayLike(dto);
    }
}
